<template>
  <div>
    <MyHeader :background="'blue'" :fontColor="'white'" title="TabBar案例"></MyHeader>
    <div class="main">
      <component :is="comName"></component>
    </div>
    <MyTabBar :arr="tabList" @changeCom="changeComFn"></MyTabBar>
  </div>
</template>

<script>
import MyHeader from "./components/MyHeader"
import MyTabBar from "./components/MyTabBar.vue"
import MyGoodsList from "./components/MyGoodsList.vue"
import MyTable from "@/components/MyTable"
import MyGoodsSearch from "@/components/MyGoodsSearch"
import MyUserInfo from "@/components/MyUserInfo"
export default {
  components: {
    MyTabBar,
    MyHeader,
    MyGoodsList,
    MyTable,
    MyGoodsSearch,
    MyUserInfo,
  },
  data() {
    return {
      comName: "MyGoodsList",
      tabList: [
        {
          iconText: "icon-shangpinliebiao",
          text: "商品列表",
          componentName: "MyGoodsList",
        },
        {
          iconText: "icon-sousuo",
          text: "商品搜索",
          componentName: "MyGoodsSearch",
        },
        {
          iconText: "icon-user",
          text: "我的信息",
          componentName: "MyUserInfo",
        },
      ],
    }
  },
  methods: {
    changeComFn(cName) {
      this.comName = cName
    },
  },
}
</script>

<style scoped>
.main {
  padding-top: 45px;
  padding-bottom: 51px;
}
</style>
